<table class="table table-bordered" id="webuser-lists-table" data-toggle="datagrid" data-options="{
    tableWidth: '100%',
    height: '100%',
    gridTitle : '工序列表',
    showToolbar: true,
    toolbarItem: 'add,del',
    local: 'remote',
    dataUrl: '/admin/system/company-list',
    linenumberAll: false,
    showLinenumber: false,
    showCheckboxcol: true,
    filterThead: false,
    showEditbtnscol: '操作',
    editMode: {dialog:{id:'company-edit', url:'/admin/system/company-edit', type:'get', title:'供应商添加', width:700, height:500}},
    editUrl: '/admin/system/company-edit',
    editCallback:editCallback,
    delUrl:'/admin/system/company-delete',
    delPK:'id',
    delConfirm: true,
}">
    <thead>
    <tr>
        <th data-options="{name:'title',width:200,align:'center'}">企业名称</th>
        <th data-options="{name:'scan_code',width:200,type:'select',items:[{0:'不需要扫描'},{1:'需要扫描'}],align:'center'}">领取材料二维码</th>
        <th data-options="{align:'center',render:companyListSet}">设置</th>
    </tr>
    </thead>
</table>
<script type="text/javascript">

    function companyListSet(value, data)
    {
        var company_id   = data.id;
        var login_html  = '<button type="button" class="btn btn-info" data-toggle="dialog" data-options="';
        login_html      += '{id:\'system-adminuser-edit-dialog\',title:\'设置 '+ data.title +' 登录账号\',';
        login_html      += 'fresh:true,width:570,';
        login_html      += 'url:\'/admin/system/adminuser-edit\',data:{company_id:' + company_id + ',ftype:2}}';
        login_html      += '"> 登录账号</button>';
        var copy_html   = '<button type="button" class="btn btn-info" data-toggle="dialog" data-options="';
        copy_html       += '{id:\'system-copy-index-dialog\',title:\''+ data.title +' 复制角色模块\',';
        copy_html       += 'fresh:true,width:500,height:350,';
        copy_html       += 'url:\'/admin/system/copy-index?item_id=1\',data:{company_id:' + company_id + '}}';
        copy_html       += '"> 复制角色</button>';
        var process_html   = '<button type="button" class="btn btn-info" data-toggle="dialog" data-options="';
        process_html       += '{id:\'system-copy-index-dialog\',title:\''+ data.title +' 复制工艺模块\',';
        process_html       += 'fresh:true,width:750,height:500,';
        process_html       += 'url:\'/admin/system/copy-index?item_id=2\',data:{company_id:' + company_id + '}}';
        process_html       += '"> 复制工艺</button>';
        var product_html   = '<button type="button" class="btn btn-info" data-toggle="dialog" data-options="';
        product_html       += '{id:\'system-copy-index-dialog\',title:\''+ data.title +' 复制材料模块\',';
        product_html       += 'fresh:true,width:500,height:350,';
        product_html       += 'url:\'/admin/system/copy-index?item_id=3\',data:{company_id:' + company_id + '}}';
        product_html       += '"> 复制材料</button>';
        if(company_id == 1)
        {
            return '';
        } else {
            var html        = login_html+copy_html+process_html+product_html;
            return html;
        }
    }
</script>

<script>
    function refreshList() {
        BJUI.navtab('refresh');
    }
</script>